package example.chapter6;

import com.opensymphony.xwork2.ActionSupport;

import example.model.ComputerPart;

public class ComputerPartAction extends ActionSupport{
	private ComputerPart nodeRoot;
	private String nodeId;
	private ComputerPart nodeCurrent;
	
	public String execute() throws Exception{
		nodeRoot = ComputerPart.getById("0");
		return SUCCESS;
	}
	
	public String selectPart() throws Exception{
		nodeCurrent = ComputerPart.getById(nodeId);
		return "success";
	}
	

	public ComputerPart getNodeRoot() {
		return nodeRoot;
	}

	public void setNodeRoot(ComputerPart nodeRoot) {
		this.nodeRoot = nodeRoot;
	}

	public String getNodeId() {
		return nodeId;
	}

	public void setNodeId(String nodeId) {
		this.nodeId = nodeId;
	}

	public ComputerPart getNodeCurrent() {
		return nodeCurrent;
	}

	public void setNodeCurrent(ComputerPart nodeCurrent) {
		this.nodeCurrent = nodeCurrent;
	}
	
}
